<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>注册五子棋游戏账号</title>
</head>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<body>
	
  <div style="width:400px;margin:0 auto;">
  
  	<form class="form-horizontal" id="date" method="post" onsubmit="return insert();">
    <fieldset>
      <div id="legend" class="">
        <legend class="">注册游戏账号</legend>
      </div>
      <div class="control-group">

          <!-- Text input-->
          <label class="control-label" >昵称</label>
          <div class="controls">
            <input type="text" placeholder="" class="input-xlarge" name="nickName">
           
          </div>
        </div>
    <div class="control-group">

          <!-- Text input-->
          <label class="control-label">用户名</label>
          <div class="controls">
            <input type="text" placeholder="" class="input-xlarge" name ="userName">
        
          </div>
        </div>

    <div class="control-group">

          <!-- Text input-->
          <label class="control-label" >密码</label>
          <div class="controls">
            <input type="password" placeholder="" class="input-xlarge" name="passWord">
           
          </div>
        </div>

 
    

    

    
	<br/>
    <div class="control-group">
        

          <!-- Button -->
          <div class="controls">
            <button class="btn btn-success" id="sumbit" type="submit" >注册</button>
          </div>
        </div>

    </fieldset>
  </form>
	
  </div>
</body>
<script>
	function insert (){
    	
		$("#sumbit").attr('disabled',true);
        $.ajax({
            async: false,
            type: "post",
            url:'/adduser',
            contentType : "application/x-www-form-urlencoded; charset=utf-8",
            data:$("#date").serialize(),
            dataType: "text",
            success: function (date) {
            		
            		alert(date)
            		$("#sumbit").attr('disabled',false);
              },
            error: function () {
            }
        })
     return false;
    }
</script>
</html>